SET IDENTITY_INSERT [CMS_Query] ON
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7434, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Community_Invitation WHERE (InvitationLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1962, 0, '20081229 09:07:09', '1b056323-7285-40dc-b754-393938b136f4', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7443, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Media_Library WHERE (LibraryLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1934, 0, '20081229 09:07:11', '52182815-0b58-420b-804b-70434d87197c', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7352, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Message WHERE (MessageLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1791, 0, '20081229 09:07:11', '13032854-907e-4c12-8b94-b7ac68aa80b4', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7354, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Subscription WHERE (SubscriptionLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1895, 0, '20081229 09:07:12', '0131391b-a266-4142-b5c1-b952e59c99d8', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7355, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Notification_Gateway WHERE (GatewayLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1808, 0, '20081229 09:07:13', 'e64d6cf8-f133-4d96-ab39-e2f27edd4c1b', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7356, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Notification_Subscription WHERE (SubscriptionLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1815, 0, '20081229 09:07:13', '40397fa5-533c-4943-94e2-d9ba53b87ae7', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7357, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Notification_Template WHERE (TemplateLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1813, 0, '20081229 09:07:13', 'fe9b3991-b080-4538-8820-e709b0abc961', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7358, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Notification_TemplateText WHERE (TemplateTextLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1814, 0, '20081229 09:07:13', '194b62e9-9d0a-4331-aad7-90aacbe72d3f', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7163, N'selectMemberUsersInSites', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_Community_Member WHERE (##WHERE##) ORDER BY ##ORDERBY##', 0, 1749, 0, '20090106 21:20:31', '5b2f88f6-086b-4760-b0ee-b344f24a7284', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6622, N'selectcategories', 0, N'SELECT ##TOPN## ##COLUMNS## FROM CMS_Category WHERE (CategoryID IN (SELECT TemplateCategoryID FROM Notification_Template)) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1814, 0, '20080829 00:00:00', '945a124a-20a1-201a-2141-1254879541a2', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6624, N'selectculturebywordid', 0, N'SELECT CultureCode FROM CMS_Culture WHERE CultureID IN (SELECT CultureID FROM BadWords_WordCulture WHERE WordID = @WordID)', 0, 1803, 0, '20080902 11:59:41', '0518c92f-d596-4dbf-bda0-359d85371bdd', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5302, N'select', 0, N'SELECT ##COLUMNS## FROM COM_PaymentShipping WHERE [PaymentOptionID] = @PaymentOptionID AND [ShippingOptionID] = @ShippingOptionID', 0, 1661, 0, '20081229 09:07:15', '4fd39d4f-a2cb-4ed7-93be-e7cf2284dece', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4985, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Reporting_SavedReport WHERE (SavedReportLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1350, 0, '20081229 09:07:22', '4061884b-6853-4e04-bffa-8199b3b1544c', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4994, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Forums_ForumPost WHERE (PostLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1123, 0, '20100210 17:47:07', '5cc6a5e8-a943-48d0-bdaa-2cd1fafda38b', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4995, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Forums_ForumSubscription WHERE (SubscriptionLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1124, 0, '20081229 09:07:08', '5ae04de8-6ffe-4fc3-9c8e-73ff081eb99a', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4997, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_VolumeDiscount WHERE (VolumeDiscountLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1424, 0, '20081229 09:07:03', 'ecbd9f2a-dbec-4bf6-a3c6-567a5bb14f6b', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3624, N'selectspec', 0, N'SELECT * FROM Analytics_Statistics, ##HITSTABLE## WHERE ##WHERE## AND StatisticsSiteID=@SiteID AND StatisticsCode=@CodeName AND StatisticsID=HitsStatisticsID AND HitsStartTime <= @Time AND @Time < HitsEndTime', 0, 1366, 0, '20090528 09:34:42', 'fc3467a3-c51c-4dbc-8021-49ac73778ce9', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3364, N'selectroles', 0, N'SELECT * FROM CMS_Role INNER JOIN Polls_PollRoles ON CMS_Role.RoleID=Polls_PollRoles.RoleID WHERE Polls_PollRoles.PollID=@PollID', 0, 1330, 0, '20080313 09:35:00', '2dfc08fc-9b0a-4ba8-a5fe-db86c1724cfa', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2901, N'selectTaxClasses', 0, N'SELECT COM_SKUTaxClasses.SKUID, COM_TaxClassCountry.IsFlatValue, COM_TaxClassCountry.TaxValue, COM_TaxClass.TaxClassID, COM_TaxClass.TaxClassDisplayName, COM_TaxClass.TaxClassZeroIfIDSupplied FROM (COM_SKUTaxClasses INNER JOIN COM_TaxClass ON COM_SKUTaxClasses.TaxClassID = COM_TaxClass.TaxClassID) INNER JOIN COM_TaxClassCountry ON COM_TaxClass.TaxClassID = COM_TaxClassCountry.TaxClassID WHERE (COM_TaxClassCountry.CountryID = @CountryID) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1162, 0, '20080313 09:35:00', '1ffde108-8e4d-41aa-8405-fa31dc733e98', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2481, N'select', 0, N'SELECT ##COLUMNS## FROM Forums_ForumSubscription WHERE [SubscriptionID] = @ID', 0, 1124, 0, '20081229 09:07:08', 'bb73812a-ab53-45d2-98f5-e87561a143bb', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1752, N'selectemails', 0, N'SELECT * FROM Newsletter_Emails WHERE EmailSiteID = @SiteID', 0, 919, 0, '20081103 12:52:38', '9a3e9082-3bc1-456d-985a-256d94c0ff54', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2568, N'select', 0, N'SELECT ##COLUMNS## FROM Staging_Task WHERE [TaskID] = @ID', 0, 1134, 0, '20100322 15:42:01', '96fb4557-2d19-4c16-a012-eaf823bcc46e', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3838, N'select', 0, N'SELECT ##COLUMNS## FROM Reporting_ReportCategory WHERE [CategoryID] = @ID', 0, 1431, 0, '20081229 09:07:21', 'fdf900dc-041a-418f-aed4-e21824c0c25e', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4979, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Reporting_ReportCategory WHERE (CategoryLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1431, 0, '20081229 09:07:21', 'd3386cf4-6dd4-4c1a-ac77-1ceb016aa8f5', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3594, N'select', 0, N'SELECT ##COLUMNS## FROM Analytics_DayHits WHERE [HitsID] = @ID', 0, 1368, 0, '20081229 09:06:53', '1ff9ac00-25c2-4427-89f0-e4e8fdc501f2', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3584, N'select', 0, N'SELECT ##COLUMNS## FROM Analytics_HourHits WHERE [HitsID] = @ID', 0, 1367, 0, '20081229 09:06:53', '782375c1-5ea9-4f82-a68d-86eeb5866251', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3599, N'select', 0, N'SELECT ##COLUMNS## FROM Analytics_MonthHits WHERE [HitsID] = @ID', 0, 1369, 0, '20081229 09:06:53', '7cabf198-deda-4f8a-8036-9e1c7c00daa2', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3604, N'select', 0, N'SELECT ##COLUMNS## FROM Analytics_WeekHits WHERE [HitsID] = @ID', 0, 1370, 0, '20081229 09:06:53', 'cbd980e3-e297-4b19-836c-f86fc545e4a2', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3609, N'select', 0, N'SELECT ##COLUMNS## FROM Analytics_YearHits WHERE [HitsID] = @ID', 0, 1371, 0, '20081229 09:06:53', 'a74fc644-d8cd-46e6-8c47-9123d6446cb6', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2557, N'select', 0, N'SELECT ##COLUMNS## FROM Staging_Server WHERE [ServerID] = @ID', 0, 1132, 0, '20100907 09:46:30', '865adada-386a-43d1-ab31-d61cdbf514e3', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4996, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Staging_Server WHERE (ServerLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1132, 0, '20100907 09:47:02', '07265c30-34f7-459b-9c32-87d4ee9c2ab3', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3579, N'select', 0, N'SELECT ##COLUMNS## FROM Analytics_Statistics WHERE [StatisticsID] = @ID', 0, 1366, 0, '20081229 09:06:53', 'ae1a23da-ea91-4181-bd90-cbb64f6c9533', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5330, N'selectByFullName', 0, N'IF @ReportName = '''' BEGIN SELECT * FROM Reporting_ReportGraph WHERE [GraphName] = @ReportGraphName END ELSE BEGIN SELECT * FROM Reporting_ReportGraph,Reporting_Report WHERE Reporting_ReportGraph.GraphReportID = Reporting_Report.ReportID AND [GraphName] = @ReportGraphName AND [ReportName] = @ReportName END', 0, 1339, 0, '20101005 10:01:04', '375b1f40-1a43-4f7a-a630-a35669d564a3', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5327, N'selectByFullName', 0, N'IF @ReportName = '''' BEGIN SELECT * FROM Reporting_ReportTable WHERE [TableName] = @ReportTableName END ELSE BEGIN SELECT * FROM Reporting_ReportTable,Reporting_Report WHERE Reporting_ReportTable.TableReportID = Reporting_Report.ReportID AND [TableName] = @ReportTableName AND [ReportName] = @ReportName END', 0, 1341, 0, '20101005 10:06:46', '264a1e30-1a43-4f7a-a630-a35669d564a3', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5323, N'selectByFullName', 0, N'IF @ReportName = '''' BEGIN SELECT * FROM Reporting_ReportValue WHERE [ValueName] = @ReportValueName END ELSE BEGIN SELECT * FROM Reporting_ReportValue,Reporting_Report WHERE Reporting_ReportValue.ValueReportID = Reporting_Report.ReportID AND [ValueName] = @ReportValueName AND [ReportName] = @ReportName END', 0, 1342, 0, '20101005 10:08:11', 'ef1accd4-aca7-4281-b6a9-b757ecc57431', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2602, N'selectByDocumentId', 0, N'SELECT * FROM  [Forums_Forum] WHERE ForumDocumentID = @ID', 0, 1122, 0, '20101005 11:44:37', 'ad6d6838-b6ba-40d8-9056-85890c7eef1e', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4086, N'selectCategoryAndReport', 0, N'SELECT CategoryDisplayName + '' - '' + ReportDisplayName AS ''CategoryAndReportName'', ReportID FROM Reporting_Report INNER JOIN Reporting_ReportCategory ON Reporting_Report.ReportCategoryID = Reporting_ReportCategory.CategoryID ORDER BY Reporting_ReportCategory.CategoryDisplayName, Reporting_Report.ReportDisplayName', 0, 1338, 0, '20101005 12:01:28', '4e039996-cbdc-4fdb-877b-6719f1fa5f79', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2693, N'select', 0, N'SELECT ##COLUMNS## FROM COM_DiscountCoupon WHERE [DiscountCouponID] = @ID', 0, 1149, 0, '20081229 09:07:00', 'cbc5f9b0-bffd-49a0-831c-e6efd5112765', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5015, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_DiscountCoupon WHERE (DiscountCouponLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1149, 0, '20081229 09:07:00', '74f2a887-e1af-4e1a-b155-88e66bb40182', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3824, N'select', 0, N'SELECT ##COLUMNS## FROM COM_DiscountLevel WHERE [DiscountLevelID] = @ID', 0, 1429, 0, '20081229 09:07:00', '95fde188-ab37-4765-96df-fb10a9489e88', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5014, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_DiscountLevel WHERE (DiscountLevelLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1429, 0, '20081229 09:07:00', '26540d23-678e-400c-b6d8-b4ca614e3e63', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2645, N'select', 0, N'SELECT ##COLUMNS## FROM COM_Manufacturer WHERE [ManufacturerID] = @ID', 0, 1142, 0, '20081229 09:07:00', '363ca775-1974-4662-8b41-4e6698d67e64', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5011, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Manufacturer WHERE (ManufacturerLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1142, 0, '20081229 09:07:01', '89426950-8fce-4d98-ab39-67c284531bc2', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2638, N'select', 0, N'SELECT ##COLUMNS## FROM COM_Supplier WHERE [SupplierID] = @ID', 0, 1141, 0, '20081229 09:07:03', '815669f0-ebcc-43fb-ae84-64a42ec9bdd8', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4992, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Supplier WHERE (SupplierLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1141, 0, '20081229 09:07:03', '0a4bf5be-f665-41c5-8410-9d25c97073e2', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2683, N'select', 0, N'SELECT ##COLUMNS## FROM COM_Department WHERE [DepartmentID] = @ID', 0, 1148, 0, '20081229 09:07:00', 'b97b5d30-6c02-419b-9e10-a81099b79485', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5016, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Department WHERE (DepartmentLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1148, 0, '20081229 09:07:00', 'aec64e05-d0c4-4024-ad2f-6e0c208dcfd6', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2723, N'select', 0, N'SELECT ##COLUMNS## FROM COM_TaxClass WHERE [TaxClassID] = @ID', 0, 1152, 0, '20081229 09:07:03', 'e62c09bc-3e5a-4bb4-847f-95ab94c9d733', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4990, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_TaxClass WHERE (TaxClassLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1152, 0, '20081229 09:07:03', '4a93fe53-595c-43a1-8cfb-dda96388b069', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2666, N'select', 0, N'SELECT ##COLUMNS## FROM COM_PublicStatus WHERE [PublicStatusID] = @ID', 0, 1145, 0, '20081229 09:07:02', '3bc45ef5-dfef-4531-b9ed-7f359bd0aa81', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5005, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_PublicStatus WHERE (PublicStatusLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1145, 0, '20081229 09:07:02', '647a41f1-3913-48e3-970b-6767ee90b8ec', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2677, N'select', 0, N'SELECT ##COLUMNS## FROM COM_InternalStatus WHERE [InternalStatusID] = @ID', 0, 1147, 0, '20081229 09:07:00', '2026b3e6-95b8-4c44-a42e-405728f68740', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5012, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_InternalStatus WHERE (InternalStatusLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1147, 0, '20081229 09:07:00', 'bc7ba915-5ac2-4166-8b1b-1ad34c34d03e', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6373, N'select', 0, N'SELECT ##COLUMNS## FROM BadWords_Word WHERE [WordID] = @ID', 0, 1771, 0, '20101124 19:03:24', '51c91ede-825b-4629-9300-b89ba2d33970', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7341, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM BadWords_Word WHERE (WordLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1771, 0, '20091012 08:49:37', 'e876d2ce-6756-4679-8a3b-cd75f44946d4', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2711, N'select', 0, N'SELECT ##COLUMNS## FROM COM_ShippingOption WHERE [ShippingOptionID] = @ID', 0, 1150, 0, '20081229 09:07:02', '8a352f14-62f9-4299-b55d-18298dc7967a', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5004, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_ShippingOption WHERE (ShippingOptionLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1150, 0, '20081229 09:07:02', 'ee5e7200-f1ff-4b36-a923-b4a83dee4e8f', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2746, N'select', 0, N'SELECT ##COLUMNS## FROM COM_Address WHERE [AddressID] = @ID', 0, 1156, 0, '20081229 09:06:59', '0de4d564-692d-4d29-9e80-969956b1d6d0', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5019, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Address WHERE (AddressLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1156, 0, '20081229 09:07:00', '91963abb-b917-4a74-a05c-f0341a573fd9', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2653, N'select', 0, N'SELECT ##COLUMNS## FROM COM_Currency WHERE [CurrencyID] = @ID', 0, 1143, 0, '20081229 09:07:00', '7cefcb82-da16-4e77-b7c6-529854a072b1', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5018, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Currency WHERE (CurrencyLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1143, 0, '20081229 09:07:00', 'c3c03c39-436f-4984-a0c6-820aff3bedc3', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4675, N'select', 0, N'SELECT ##COLUMNS## FROM Messaging_Message WHERE [MessageID] = @ID', 0, 1593, 0, '20081229 09:07:12', '9cb5f085-31e7-46f2-ab0b-670451575bc8', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4999, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Messaging_Message WHERE (MessageLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1593, 0, '20091012 08:47:31', '196c07c4-6078-4b82-8e66-e385ec8be581', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1300, N'select', 0, N'SELECT ##COLUMNS## FROM Newsletter_NewsletterIssue WHERE [IssueID] = @ID', 0, 907, 0, '20090910 14:21:30', '88ba9984-ad87-4196-ba48-257dfa02e7e6', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4976, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Newsletter_NewsletterIssue WHERE (IssueLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 907, 0, '20090910 14:21:30', 'e247e0fa-15e9-46fc-910e-536015a91215', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7925, N'SelectForUniGrid', 0, N'SELECT ##TOPN## ##COLUMNS## FROM (SELECT resourceStrings1.StringKey, resourceStrings1.StringIsCustom, CAST(defaultLanguage.TranslationText AS nvarchar(4000)) AS DefaultText, CAST(cultureLanguage.TranslationText AS nvarchar(4000)) AS CultureText  FROM CMS_ResourceTranslation AS defaultLanguage INNER JOIN CMS_ResourceString AS resourceStrings1 ON resourceStrings1.StringID = defaultLanguage.TranslationStringID LEFT OUTER JOIN CMS_ResourceTranslation AS cultureLanguage ON defaultLanguage.TranslationStringID = cultureLanguage.TranslationStringID AND (cultureLanguage.TranslationUICultureID IS NULL OR cultureLanguage.TranslationUICultureID = @Culture) WHERE (defaultLanguage.TranslationUICultureID = @DefaultUICultureID)  UNION SELECT resourceStrings2.StringKey,  resourceStrings2.StringIsCustom, CAST(defaultLanguage.TranslationText AS nvarchar(4000)) AS DefaultText, CAST(cultureLanguage.TranslationText AS nvarchar(4000)) AS CultureText  FROM CMS_ResourceTranslation AS cultureLanguage INNER JOIN CMS_ResourceString AS resourceStrings2 ON resourceStrings2.StringID = cultureLanguage.TranslationStringID LEFT OUTER JOIN CMS_ResourceTranslation AS defaultLanguage ON defaultLanguage.TranslationStringID = cultureLanguage.TranslationStringID AND defaultLanguage.TranslationUICultureID IS NULL WHERE (cultureLanguage.TranslationUICultureID = @Culture) AND (NOT EXISTS (SELECT TranslationID, TranslationStringID, TranslationUICultureID, CAST(TranslationText AS nvarchar(4000)) AS Expr1 FROM CMS_ResourceTranslation WHERE (TranslationUICultureID = @DefaultUICultureID) AND (TranslationStringID = cultureLanguage.TranslationStringID))) UNION SELECT StringKey, StringIsCustom, NULL AS DefaultText, NULL AS CultureText FROM CMS_ResourceString WHERE (StringID NOT IN (SELECT TranslationStringID FROM CMS_ResourceTranslation AS CMS_ResourceTranslation_1 WHERE (TranslationUICultureID = @Culture) OR (TranslationUICultureID = @DefaultUICultureID)))) AS StringInfoRows WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1650, 0, '20110105 12:09:35', 'b56e95ab-5979-4d42-8794-8f887b838929', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2476, N'select', 0, N'SELECT ##COLUMNS## FROM Forums_ForumPost WHERE [PostId] = @ID', 0, 1123, 0, '20110113 10:56:10', 'a1de3962-8aef-4f3e-a88b-96338adeebcb', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2717, N'select', 0, N'SELECT ##COLUMNS## FROM COM_ExchangeTable WHERE [ExchangeTableID] = @ID', 0, 1151, 0, '20081229 09:07:00', 'f5ff037c-f717-4423-be4c-37abe48ec89a', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5013, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_ExchangeTable WHERE (ExchangeTableLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1151, 0, '20081229 09:07:00', '0eb503b6-7531-4267-a074-45871e289b7c', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2968, N'selectLastValid', 0, N'SELECT * FROM COM_ExchangeTable WHERE (((ExchangeTableValidFrom <= @CurrentDate) OR (ExchangeTableValidFrom IS NULL)) AND ((ExchangeTableValidTo >= @CurrentDate) OR (ExchangeTableValidTo IS NULL))) AND ISNULL(ExchangeTableSiteID, 0) = @SiteID ORDER BY ExchangeTableValidFrom DESC, CASE WHEN ExchangeTableValidTo IS NULL THEN 2 ELSE 1 END, ExchangeTableValidTo', 0, 1151, 0, '20110218 12:42:01', '0d9b6d23-972d-4415-9775-0afd2aee2426', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2563, N'select', 0, N'SELECT ##COLUMNS## FROM Staging_SyncLog WHERE [SyncLogID] = @ID', 0, 1133, 0, '20110301 18:29:14', '58c981f0-664f-4923-942e-ab78eaf5af6a', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12582, N'SelectCountriesAndTaxValues', 0, N'SELECT * FROM CMS_Country LEFT OUTER JOIN COM_TaxClassCountry ON CMS_Country.CountryID = COM_TaxClassCountry.CountryID AND COM_TaxClassCountry.TaxClassID = @TaxClassID', 0, 1154, 0, '20110311 14:54:09', '1c2b5fe3-50bd-46de-a6e3-8d1f72e1e19f', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3979, N'SelectStatesAndTaxValues', 0, N'SELECT * FROM CMS_State LEFT OUTER JOIN COM_TaxClassState ON CMS_State.StateID = COM_TaxClassState.StateID AND COM_TaxClassState.TaxClassID = @TaxClassId WHERE CMS_State.CountryID=@CountryID;', 0, 1448, 0, '20110311 14:55:24', 'f128c5fa-d61a-433b-b297-7a87cdf323c3', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4343, N'selectrelatedproductsbybuy', 0, N'SELECT ##COLUMNS## FROM COM_SKU
WHERE SKUID IN
(
  SELECT OrderItemSKUID 
  FROM COM_OrderItem LEFT OUTER JOIN COM_Order ON (OrderItemOrderID = OrderID) 
  WHERE (OrderSiteID = @SiteID) AND (OrderItemSKUID <> @SKUID) AND (OrderItemOrderID IN (SELECT OrderItemOrderID FROM COM_OrderItem WHERE OrderItemSKUID=@SKUID))       
) AND (##WHERE##)', 0, 1159, 0, '20110316 16:51:53', 'f979a10f-349d-49b4-84f2-abc34993d057', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2814, N'select', 0, N'SELECT ##COLUMNS## FROM COM_OrderStatusUser WHERE [OrderStatusUserID] = @ID', 0, 1163, 0, '20081229 09:07:02', 'b82c5132-173c-40d5-845d-fc815e5130f2', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2759, N'select', 0, N'SELECT ##COLUMNS## FROM COM_Customer WHERE [CustomerID] = @ID', 0, 1157, 0, '20110325 08:38:35', '9a2ae19e-47bb-42ba-9b3b-5092cf917358', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5017, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Customer WHERE (CustomerLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1157, 0, '20110325 08:38:35', '236c5cfc-e74c-4690-a537-f7323ff8b4e3', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2808, N'select', 0, N'SELECT ##COLUMNS## FROM COM_ShoppingCart WHERE [ShoppingCartID] = @ID', 0, 1162, 0, '20110325 08:41:38', '2740274e-71fa-454e-a604-9410e8950957', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12446, N'selectlastinvalidrate', 0, N'SELECT ExchangeRateValue 
FROM COM_CurrencyExchangeRate INNER JOIN COM_ExchangeTable ON COM_CurrencyExchangeRate.ExchangeTableID = COM_ExchangeTable.ExchangeTableID 
WHERE (ExchangeRateToCurrencyID = @CurrencyID) AND (ISNULL(COM_ExchangeTable.ExchangeTableSiteID, 0) = @SiteID) AND (ExchangeTableValidTo < @CurrentDate)
ORDER BY ExchangeTableValidTo DESC', 0, 1202, 0, '20110401 14:03:52', '37cb2ddb-1510-45cc-ab3b-4383e6cbed04', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5769, N'selectLastInvalid', 0, N'SELECT * FROM COM_ExchangeTable 
WHERE (ExchangeTableValidTo < @CurrentDate) AND (ISNULL(ExchangeTableSiteID, 0) = @SiteID)
ORDER BY ExchangeTableValidTo DESC', 0, 1151, 0, '20110401 15:28:35', '4d6e3ee1-8d04-421b-8e23-f8f61efa7e8d', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3400, N'select', 0, N'SELECT ##COLUMNS## FROM Reporting_ReportGraph WHERE [GraphID] = @ID', 0, 1339, 0, '20110404 13:42:56', 'e9b84482-1f63-4101-8cc7-25cee7845710', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4981, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Reporting_ReportGraph WHERE (GraphLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1339, 0, '20110404 13:42:57', '9370343b-777b-48d2-b06f-1b6beee3eabb', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3452, N'selectpreviousenabledstatus', 0, N'SELECT TOP 1 * FROM COM_OrderStatus WHERE StatusOrder < (SELECT StatusOrder FROM COM_OrderStatus WHERE StatusID = @StatusID) AND ISNULL(StatusSiteID, 0) = (SELECT ISNULL(StatusSiteID, 0) FROM COM_OrderStatus WHERE StatusID = @StatusID) AND StatusEnabled = 1 ORDER BY StatusOrder DESC', 0, 1146, 0, '20110408 10:53:21', 'a36252e8-1af4-452b-aace-495972352e53', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3450, N'selectnextenabledstatus', 0, N'SELECT TOP 1 * FROM COM_OrderStatus WHERE StatusOrder > (SELECT StatusOrder FROM COM_OrderStatus WHERE StatusID = @StatusID) AND ISNULL(StatusSiteID, 0) = (SELECT ISNULL(StatusSiteID, 0) FROM COM_OrderStatus WHERE StatusID = @StatusID) AND StatusEnabled = 1 ORDER BY StatusOrder', 0, 1146, 0, '20110408 10:53:31', 'fb12b4b5-d8d1-4676-9ead-058ce8e515a6', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4276, N'select', 0, N'SELECT ##COLUMNS## FROM COM_CustomerCreditHistory WHERE [EventID] = @ID', 0, 1518, 0, '20110412 08:04:09', '0a26049c-b1bb-47a0-8539-4d09da9f7cd9', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7345, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_CustomerCreditHistory WHERE (EventCreditLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1518, 0, '20110412 08:04:09', '6effb32a-3880-40b1-8ec2-1044d337c7de', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2627, N'selectlog', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Staging_SyncLog INNER JOIN Staging_Server ON Staging_SyncLog.SyncLogServerID = Staging_Server.ServerID 
INNER JOIN Staging_Task ON Staging_SyncLog.SyncLogTaskID = Staging_Task.TaskID 
WHERE (TaskID = @TaskID OR @TaskID = 0) AND (ServerID = @ServerID OR @ServerID = 0) AND ##WHERE## ORDER BY ##ORDERBY##', 0, 1133, 0, '20110419 17:42:27', '4f0c19dd-4c13-4735-96b6-068c40013d9b', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3957, N'select', 0, N'SELECT ##COLUMNS## FROM COM_TaxClassState WHERE [TaxClassStateID] = @ID', 0, 1448, 0, '20110428 13:36:02', 'dd971b60-8872-4da8-b9ae-b5494bafea7f', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2784, N'select', 0, N'SELECT ##COLUMNS## FROM COM_TaxClassCountry WHERE [TaxClassCountryID] = @ID', 0, 1154, 0, '20110428 13:56:33', 'ab277fca-69eb-4954-ba51-023b2b1865ee', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2672, N'select', 0, N'SELECT ##COLUMNS## FROM COM_OrderStatus WHERE [StatusID] = @ID', 0, 1146, 0, '20110516 14:54:41', 'b3b57de5-c83b-4cf6-95a7-5e6996089f44', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5007, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_OrderStatus WHERE (StatusLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1146, 0, '20110516 14:54:41', '383a0b54-0a78-4cd5-8646-9bfe0d271f3d', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4969, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Polls_Poll WHERE (PollLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1330, 0, '20110524 09:35:18', '90e75769-8d74-43a2-889b-43ab5e99cb3d', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7075, N'selectfriendships', 0, N'SELECT ##TOPN## ##COLUMNS## FROM ((SELECT * FROM View_Community_Friend_Friends WHERE FriendRequestedUserID=@UserID) 
UNION ALL 
(SELECT * FROM View_Community_Friend_RequestedFriends WHERE FriendUserID=@UserID)) Friendships WHERE (##WHERE##) ORDER BY ##ORDERBY##', 0, 1898, 0, '20110530 11:40:32', '77b4370e-1047-46ee-9f6f-c21af76d5428', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6916, N'select', 0, N'SELECT ##COLUMNS## FROM Community_Friend WHERE [FriendID] = @ID', 0, 1898, 0, '20110530 11:40:40', '704e95ef-009c-449d-82c1-796833690d51', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1341, N'select', 0, N'SELECT ##COLUMNS## FROM Newsletter_Newsletter WHERE [NewsletterID] = @ID', 0, 913, 0, '20110603 15:41:52', '4090101d-f4ce-431c-920e-5ddc5d8cbe28', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4931, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Newsletter_Newsletter WHERE (NewsletterLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 913, 0, '20110603 15:41:52', '3017d807-8ba7-4eab-bd40-1ca1b5358033', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3469, N'select', 0, N'SELECT ##COLUMNS## FROM Reporting_SavedGraph WHERE [SavedGraphID] = @ID', 0, 1349, 0, '20110607 08:54:38', '65bed233-d06a-489d-bb90-206786420673', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4984, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Reporting_SavedGraph WHERE (SavedGraphLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1349, 0, '20110607 08:54:39', 'f08c9d70-0b82-4e08-9663-d9126a592d1d', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7620, N'selectnobinary', 0, N'SELECT [SavedGraphID], [SavedGraphSavedReportID], [SavedGraphGUID], [SavedGraphMimeType], [SavedGraphLastModified] FROM Reporting_SavedGraph WHERE [SavedGraphID] = @ID', 0, 1349, 0, '20110607 08:54:39', '32a7705f-5f53-450c-a0bb-db2d97553ab6', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6991, N'select', 0, N'SELECT ##COLUMNS## FROM Forums_Attachment WHERE [AttachmentID] = @ID', 0, 1912, 0, '20110607 08:55:36', 'c30dc219-51ca-4992-9e46-39ef308be6b6', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7349, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Forums_Attachment WHERE (AttachmentLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1912, 0, '20110607 08:55:36', 'c9087d2c-5e9f-47db-97fd-5296aee6d1ee', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7617, N'selectnobinary', 0, N'SELECT [AttachmentID], [AttachmentFileName], [AttachmentFileExtension], [AttachmentGUID], [AttachmentLastModified], [AttachmentMimeType], [AttachmentFileSize], [AttachmentImageHeight], [AttachmentImageWidth], [AttachmentPostID], [AttachmentSiteID] FROM Forums_Attachment WHERE [AttachmentID] = @ID', 0, 1912, 0, '20110607 08:55:36', 'fbc20c61-2601-4d9a-a33e-89f28797bd8f', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2466, N'select', 0, N'SELECT ##COLUMNS## FROM Forums_ForumGroup WHERE [GroupID] = @ID', 0, 1121, 0, '20110607 09:08:36', 'c83d9b87-dbf5-426d-b276-f6866009cc4f', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4993, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Forums_ForumGroup WHERE (GroupLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1121, 0, '20110607 09:08:36', 'a81e536b-d547-445d-bc9a-8bdcb07dfb47', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3365, N'selectlist', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Polls_Poll WHERE ##WHERE## ORDER BY ##ORDERBY##', 0, 1330, 0, '20110615 10:49:53', 'be102f14-4b7e-4e92-bcde-f835b45c02a8', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2819, N'selectlist', 0, N'SELECT * FROM View_COM_OrderStatusUser_Joined WHERE OrderID = @OrderID ORDER BY [Date], [OrderStatusUserID]', 0, 1163, 0, '20110615 10:50:36', 'dfee40f3-a25e-4d86-868a-0fa07dba224f', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3284, N'select', 0, N'SELECT ##COLUMNS## FROM Newsletter_SubscriberNewsletter WHERE [SubscriberID] = @SubscriberID AND [NewsletterID] = @NewsletterID', 0, 912, 0, '20110727 10:05:41', '8f2c83a0-bab7-448a-9fa5-04e25607dfbf', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2767, N'select', 0, N'SELECT ##COLUMNS## FROM COM_Order WHERE [OrderID] = @ID', 0, 1158, 0, '20110729 12:29:26', '2dfc9248-5082-4303-89b6-31b48a4db454', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5009, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_Order WHERE (OrderLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1158, 0, '20110729 12:29:27', '03043a56-809e-48df-be27-1ebe13506da9', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6251, N'select', 0, N'SELECT ##COLUMNS## FROM Community_Group WHERE [GroupID] = @ID', 0, 1748, 0, '20110811 09:35:36', '6bd3eb35-6acb-42bd-8543-3da473f787e6', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7350, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Community_Group WHERE (GroupLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1748, 0, '20110811 09:35:37', 'a5d41902-acbe-4ce9-a8e8-0f502a99cb30', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4766, N'select', 0, N'SELECT ##COLUMNS## FROM COM_ShoppingCartSKU WHERE [CartItemID] = @ID', 0, 1606, 0, '20110812 15:34:17', '95fa505a-0c4b-417f-970d-ac33cf062c2b', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2802, N'select', 0, N'SELECT ##COLUMNS## FROM COM_OrderItem WHERE [OrderItemID] = @ID', 0, 1161, 0, '20110815 14:51:20', '44007362-bd4f-4219-8ac2-6530d8601139', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5008, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_OrderItem WHERE (OrderItemLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1161, 0, '20110815 14:51:20', '2d920081-60f8-44b6-9e08-a448baf516d4', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1314, N'select', 0, N'SELECT ##COLUMNS## FROM Newsletter_Subscriber WHERE [SubscriberID] = @ID', 0, 908, 0, '20110816 10:35:35', 'd956a6fb-2a3b-4f2d-b4a6-54c6fd6d129e', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4977, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Newsletter_Subscriber WHERE (SubscriberLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 908, 0, '20110816 10:35:35', '62dcb594-665b-43a2-8580-4d99ac7c7ca5', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2773, N'select', 0, N'SELECT ##COLUMNS## FROM COM_SKU WHERE [SKUID] = @ID', 0, 1159, 0, '20110816 13:07:10', '820787d0-6f39-492b-a242-ce326d016766', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5003, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_SKU WHERE (SKULastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1159, 0, '20110816 13:07:10', '939f8f46-4d71-434b-9da9-6c244dc81c0f', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2659, N'select', 0, N'SELECT ##COLUMNS## FROM COM_PaymentOption WHERE [PaymentOptionID] = @ID', 0, 1144, 0, '20110823 20:50:00', '6c2ace65-2b0e-440d-8090-e5e01f197076', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5006, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_PaymentOption WHERE (PaymentOptionLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1144, 0, '20110823 20:50:00', '1521470a-f99a-4802-86dc-ad0fbeaf0b15', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4714, N'select', 0, N'SELECT ##COLUMNS## FROM COM_OptionCategory WHERE [CategoryID] = @ID', 0, 1596, 0, '20110905 16:29:14', '4b9af573-b48d-4f34-8e29-850acfa409db', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5010, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM COM_OptionCategory WHERE (CategoryLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1596, 0, '20110905 16:29:14', '5c7b9e2d-4d81-400e-8648-110b785e309b', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6460, N'select', 0, N'SELECT ##COLUMNS## FROM Board_Board WHERE [BoardID] = @ID', 0, 1788, 0, '20110909 14:37:18', 'f3fc0620-8295-45ec-8abd-4f9487085eb8', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7353, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Board_Board WHERE (BoardLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1788, 0, '20110909 14:37:18', '7c8ca403-4110-4f72-993f-eee35a555145', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12974, N'selectshippingoptiontaxes', 0, N'SELECT COM_TaxClass.TaxClassID, COM_TaxClass.TaxClassDisplayName, COM_TaxClass.TaxClassZeroIfIDSupplied, COM_TaxClassState.TaxValue, COM_TaxClassState.IsFlatValue AS TaxIsFlat,
        CASE WHEN (COM_TaxClass.TaxClassSiteID > 0) THEN 0 ELSE 1 END AS TaxIsGlobal
FROM COM_ShippingOptionTaxClass
JOIN COM_TaxClass ON COM_ShippingOptionTaxClass.TaxClassID = COM_TaxClass.TaxClassID
JOIN COM_TaxClassState ON COM_TaxClassState.TaxClassID = COM_TaxClass.TaxClassID
WHERE (COM_TaxClassState.StateID = @StateID) AND (COM_ShippingOptionTaxClass.ShippingOptionID = @OptionID)
UNION ALL
SELECT COM_TaxClass.TaxClassID, COM_TaxClass.TaxClassDisplayName, COM_TaxClass.TaxClassZeroIfIDSupplied, COM_TaxClassCountry.TaxValue, COM_TaxClassCountry.IsFlatValue AS TaxIsFlat,
        CASE WHEN (COM_TaxClass.TaxClassSiteID > 0) THEN 0 ELSE 1 END AS TaxIsGlobal
FROM COM_ShippingOptionTaxClass
JOIN COM_TaxClass ON COM_ShippingOptionTaxClass.TaxClassID = COM_TaxClass.TaxClassID
JOIN COM_TaxClassCountry ON COM_TaxClassCountry.TaxClassID = COM_TaxClass.TaxClassID
WHERE (COM_TaxClassCountry.CountryID = @CountryID) AND NOT EXISTS (SELECT COM_TaxClassState.TaxClassID FROM COM_TaxClassState
WHERE COM_TaxClassState.StateID = @StateID AND  COM_TaxClassState.TaxClassID = COM_TaxClass.TaxClassID AND COM_TaxClassState.TaxValue IS NOT NULL) AND (COM_ShippingOptionTaxClass.ShippingOptionID = @OptionID)', 0, 1152, 0, '20110909 16:05:15', 'e715467e-ff41-45e5-af9e-4c4e746b56a7', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (12840, N'selectshoppingcarttaxes', 0, N'SELECT COM_SKUTaxClasses.SKUID, COM_TaxClass.TaxClassID, COM_TaxClass.TaxClassDisplayName, COM_TaxClass.TaxClassZeroIfIDSupplied, COM_TaxClassState.TaxValue, COM_TaxClassState.IsFlatValue AS TaxIsFlat, 
        CASE WHEN (COM_TaxClass.TaxClassSiteID > 0) THEN 0 ELSE 1 END AS TaxIsGlobal 
FROM COM_SKUTaxClasses 
JOIN COM_TaxClass ON COM_SKUTaxClasses.TaxClassID = COM_TaxClass.TaxClassID 
JOIN COM_TaxClassState ON COM_TaxClassState.TaxClassID = COM_TaxClass.TaxClassID 
WHERE (COM_TaxClassState.StateID = @StateID) AND ##WHERE## 
UNION ALL 
SELECT COM_SKUTaxClasses.SKUID, COM_TaxClass.TaxClassID, COM_TaxClass.TaxClassDisplayName, COM_TaxClass.TaxClassZeroIfIDSupplied, COM_TaxClassCountry.TaxValue, COM_TaxClassCountry.IsFlatValue AS TaxIsFlat,
        CASE WHEN (COM_TaxClass.TaxClassSiteID > 0) THEN 0 ELSE 1 END AS TaxIsGlobal
FROM COM_SKUTaxClasses 
JOIN COM_TaxClass ON COM_SKUTaxClasses.TaxClassID = COM_TaxClass.TaxClassID 
JOIN COM_TaxClassCountry ON COM_TaxClassCountry.TaxClassID = COM_TaxClass.TaxClassID 
WHERE (COM_TaxClassCountry.CountryID = @CountryID) AND NOT EXISTS (SELECT COM_TaxClassState.TaxClassID FROM COM_TaxClassState 
    WHERE COM_TaxClassState.StateID = @StateID AND  COM_TaxClassState.TaxClassID = COM_TaxClass.TaxClassID AND COM_TaxClassState.TaxValue IS NOT NULL) AND ##WHERE##', 0, 1152, 0, '20110909 16:05:59', '1078bcc7-7d75-4679-b892-1db51b4f0840', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5728, N'selecttaxes', 0, N'SELECT COM_TaxClass.TaxClassZeroIfIDSupplied, COM_TaxClassState.TaxValue, COM_TaxClassState.IsFlatValue AS TaxIsFlat, 
	CASE WHEN (COM_TaxClass.TaxClassSiteID > 0) THEN 0 ELSE 1 END AS TaxIsGlobal 
FROM COM_SKUTaxClasses 
JOIN COM_TaxClass ON COM_SKUTaxClasses.TaxClassID = COM_TaxClass.TaxClassID 
JOIN COM_TaxClassState ON COM_TaxClassState.TaxClassID = COM_TaxClass.TaxClassID 
WHERE (COM_SKUTaxClasses.SKUID = @SKUID) AND (COM_TaxClassState.StateID = @StateID) 
UNION ALL 
SELECT COM_TaxClass.TaxClassZeroIfIDSupplied, COM_TaxClassCountry.TaxValue, COM_TaxClassCountry.IsFlatValue AS TaxIsFlat,
	CASE WHEN (COM_TaxClass.TaxClassSiteID > 0) THEN 0 ELSE 1 END AS TaxIsGlobal 
FROM COM_SKUTaxClasses 
JOIN COM_TaxClass ON COM_SKUTaxClasses.TaxClassID = COM_TaxClass.TaxClassID 
JOIN COM_TaxClassCountry ON COM_TaxClassCountry.TaxClassID = COM_TaxClass.TaxClassID 
WHERE (COM_SKUTaxClasses.SKUID = @SKUID) AND (COM_TaxClassCountry.CountryID = @CountryID) AND NOT EXISTS 
(SELECT COM_TaxClassState.TaxClassID FROM COM_TaxClassState WHERE COM_TaxClassState.StateID = @StateID AND COM_TaxClassState.TaxClassID = COM_TaxClass.TaxClassID AND COM_TaxClassState.TaxValue IS NOT NULL)', 0, 1159, 0, '20110910 12:01:04', '353f21f6-db5a-4a57-bccd-66953baaa85c', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7122, N'select', 0, N'SELECT ##COLUMNS## FROM Media_File WHERE [FileID] = @ID', 0, 1935, 0, '20110913 13:46:29', '4e7ce3f7-bdf8-40a9-8207-f2e12e11131e', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7442, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Media_File WHERE (FileModifiedWhen >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1935, 0, '20110913 13:46:30', '7f60db47-276a-4b16-b648-42b149801ee0', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2471, N'select', 0, N'SELECT ##COLUMNS## FROM Forums_Forum WHERE [ForumID] = @ID', 0, 1122, 0, '20110915 14:36:15', '41934b2b-81d2-4d07-91c3-24346cfc12ed', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4991, N'selectmodifiedfrom', 0, N'SELECT ##TOPN## ##COLUMNS## FROM Forums_Forum WHERE (ForumLastModified >= @ModifiedFrom) AND (##WHERE##) ORDER BY ##ORDERBY##', 0, 1122, 0, '20110915 14:36:15', 'c08b6cb0-4c47-4b19-b24e-98aad545bac7', 1, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1737, N'getattachmentdocumentversions', 0, N'SELECT VersionHistoryID FROM CMS_VersionAttachment WHERE AttachmentHistoryID = @AttachmentHistoryID', 0, 516, 0, '20080313 09:35:00', 'b67f3462-3881-4bb7-bd96-09ab011a7afa', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (460, N'delete', 0, N'DELETE FROM CMS_ACLItem WHERE [ACLItemID] = @ID', 0, 225, 0, '20081229 09:06:53', '853d7499-4a97-4da3-93a2-5f20607630b9', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (57, N'addusertorole', 0, N'INSERT INTO CMS_UserRole (UserID, RoleID) VALUES (@UserID, @RoleID)', 0, 59, 0, '20080313 09:35:00', 'a615214c-d32c-4726-b58b-ed472c8d6300', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (59, N'addusertosite', 0, N'INSERT INTO CMS_UserSite (UserID, SiteID) VALUES (@UserID, @SiteID)', 0, 59, 0, '20080313 09:35:00', 'a2cfe6a6-40b0-416f-96e7-c7d44e971b4c', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (441, N'changedocumentid', 0, N'UPDATE CMS_VersionHistory SET DocumentID = @NewDocumentID WHERE DocumentID = @OriginalDocumentID', 1, 214, 0, '20080313 09:35:00', '12c40bff-d7a7-422e-bce1-cbe2fb935911', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2482, N'delete', 0, N'DELETE FROM Forums_ForumSubscription WHERE [SubscriptionID] = @ID', 0, 1124, 0, '20081229 09:07:08', '8d022f93-4894-41c9-9938-bc224e0d4599', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2483, N'insert', 0, N'INSERT INTO Forums_ForumSubscription ([SubscriptionUserID], [SubscriptionEmail], [SubscriptionForumID], [SubscriptionPostID], [SubscriptionGUID], [SubscriptionLastModified] ) VALUES ( @SubscriptionUserID, @SubscriptionEmail, @SubscriptionForumID, @SubscriptionPostID, @SubscriptionGUID, @SubscriptionLastModified); SELECT SCOPE_IDENTITY() AS [SubscriptionID]', 1, 1124, 0, '20081229 09:07:08', '5a6eae0c-f649-4bd9-a9bb-f084d5c8410b', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2000, N'getlastversion', 0, N'SELECT TOP 1 * FROM CMS_AttachmentHistory WHERE AttachmentGUID = @AttachmentGUID AND AttachmentHistoryID IN (SELECT AttachmentHistoryID FROM CMS_VersionAttachment WHERE VersionHistoryID IN (SELECT VersionHistoryID FROM CMS_VersionHistory WHERE NodeSiteID=@SiteID)) ORDER BY AttachmentHistoryID DESC', 0, 516, 0, '20080313 09:35:00', 'ddea66e4-4b2d-4bfc-be83-b3e1dc2a76bd', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2002, N'changedocumentid', 0, N'UPDATE CMS_AttachmentHistory SET AttachmentDocumentID = @NewDocumentID WHERE AttachmentDocumentID = @OriginalDocumentID', 1, 516, 0, '20080313 09:35:00', 'fa8cf0ec-0b34-401a-bb62-1da819788d40', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1774, N'update', 0, N'UPDATE CMS_SiteDomainAlias SET [SiteDomainAliasName] = @SiteDomainAliasName, [SiteID] = @SiteID, [SiteDefaultVisitorCulture] = @SiteDefaultVisitorCulture, [SiteDomainGUID] = @SiteDomainGUID, [SiteDomainLastModified] = @SiteDomainLastModified, [SiteDomainDefaultAliasPath] = @SiteDomainDefaultAliasPath, [SiteDomainRedirectUrl] = @SiteDomainRedirectUrl WHERE [SiteDomainAliasID] = @SiteDomainAliasID', 0, 661, 0, '20081229 09:07:23', '0180a686-1a59-4b29-9a6b-c3448c0bed20', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2912, N'addmoderator', 0, N'INSERT INTO [Forums_ForumModerators ] (UserID, ForumID) VALUES (@USerID, @ForumID);SELECT SCOPE_IDENTITY() AS[ModeratorID]', 0, 1122, 0, '20080313 09:35:00', '8433219b-3a18-4f9a-86ac-d4e770e42ddf', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3358, N'addtosite', 0, N'INSERT INTO Polls_PollSite (PollID,SiteID) VALUES (@PollID,@SiteID)', 0, 1330, 0, '20080313 09:35:00', 'ecd2d0d8-e644-4f1d-b621-fad54421add2', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3359, N'addrole', 0, N'INSERT INTO Polls_PollRoles (PollID,RoleID) VALUES (@PollID,@RoleID)', 0, 1330, 0, '20080313 09:35:00', 'c1b19846-ca8b-4486-b43e-8c34beafcdbf', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3360, N'removefromsite', 0, N'DELETE FROM Polls_PollSite WHERE PollID=@PollID AND SiteID=@SiteID', 0, 1330, 0, '20080313 09:35:00', '3a420fd6-0087-4c51-b7c6-59a20756615a', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3361, N'removerole', 0, N'DELETE FROM Polls_PollRoles WHERE PollID=@PollID AND RoleID=@RoleID', 0, 1330, 0, '20080313 09:35:00', 'a0561502-c5df-4676-87ce-6719671cb745', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3345, N'initorders', 1, N'Proc_Polls_PollAnswer_InitOrders', 1, 1331, 0, '20080313 09:35:00', '4dbc5caf-741c-4764-b55b-2161413484be', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3347, N'moveup', 1, N'Proc_Polls_PollAnswer_MoveUp', 1, 1331, 0, '20080313 09:35:00', '9be1213e-e37f-432b-8689-4745cd5fe836', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3348, N'movedown', 1, N'Proc_Polls_PollAnswer_MoveDown', 1, 1331, 0, '20080313 09:35:00', 'fdfae8a9-fe12-4eda-80ba-d4ed397728a2', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (3373, N'updatelinks', 1, N'Proc_CMS_Tree_UpdateLinks', 1, 143, 0, '20080313 09:35:00', '0beeb311-89e6-4b09-b5fd-64ac1a00c2ef', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4159, N'addroletoform', 0, N'INSERT INTO CMS_FormRole (FormID, RoleID) VALUES (@FormID, @RoleID)', 0, 880, 0, '20080313 09:35:00', '14472481-abee-4b81-a346-fe5306da329a', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4160, N'removerolefromform', 0, N'DELETE FROM CMS_FormRole WHERE RoleID = @RoleID AND FormID = @FormID', 0, 880, 0, '20080313 09:35:00', '6301e7bf-ba18-4b93-b9d7-a58fd02f4f48', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4218, N'delete', 0, N'DELETE FROM Events_Attendee WHERE [AttendeeID] = @ID', 0, 1511, 0, '20081229 09:07:06', '3e85063c-ea09-4bce-be89-7ea94fbb83df', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4163, N'removeallrolesfromform', 0, N'DELETE FROM CMS_FormRole WHERE FormID = @FormID', 0, 880, 0, '20080313 09:35:00', '329091a3-d148-40c2-b833-531475e360da', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4166, N'orderalphaasc', 1, N'Proc_CMS_Tree_OrderAlphaAsc', 1, 143, 0, '20080313 09:35:00', 'aad59d83-e030-4eec-a925-eca543a9d9dc', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4167, N'orderalphadesc', 1, N'Proc_CMS_Tree_OrderAlphaDesc', 1, 143, 0, '20080313 09:35:00', 'ea0c33f6-b049-4d9e-9998-76ec7e3d6409', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4168, N'orderdateasc', 1, N'Proc_CMS_Tree_OrderDateAsc', 1, 143, 0, '20080313 09:35:00', 'd91b9bc0-b6c0-49a7-8788-547bc98e6173', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4169, N'orderdatedesc', 1, N'Proc_CMS_Tree_OrderDateDesc', 1, 143, 0, '20080313 09:35:00', '887f3a08-9cc4-4dbf-8d70-cb7fdb59288a', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4192, N'update', 0, N'UPDATE CMS_Relationship SET  [RelationshipCustomData] = @RelationshipCustomData WHERE ([LeftNodeID] = @LeftNodeID AND [RightNodeID]=@RightNodeID AND [RelationshipNameID]=@RelationshipNameID)', 0, 537, 1, '20080313 09:35:00', 'fd5ebf67-d733-4682-a071-e05c30eefc71', 2, 1)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4785, N'InitProductOptionOrders', 1, N'Proc_COM_ProductOption_InitOptionOrders', 1, 1159, 0, '20080313 09:35:00', '7f50fd97-16b4-401c-a51a-dbe257af7047', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4789, N'MoveProductOptionUp', 1, N'Proc_Com_ProductOption_MoveOptionUp', 1, 1159, 0, '20080313 09:35:00', '148de981-17aa-4d9f-9fa1-6cab2562b2cf', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (4790, N'MoveProductOptionDown', 1, N'Proc_Com_ProductOption_MoveOptionDown', 1, 1159, 0, '20080313 09:35:00', '1ac7240b-abe7-48dd-aa0b-87e461778248', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5155, N'delete', 0, N'DELETE FROM CMS_FormRole WHERE [FormID] = @FormID AND [RoleID] = @RoleID', 0, 1638, 0, '20081229 09:07:07', '8bbe6318-7e7a-4925-9f30-12df98124501', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5156, N'insert', 0, N'INSERT INTO CMS_FormRole ([FormID], [RoleID] ) VALUES ( @FormID, @RoleID);', 1, 1638, 0, '20081229 09:07:07', '593dd7ec-5cd6-4f31-831b-e10674523177', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5157, N'update', 0, N'SELECT NULL', 0, 1638, 0, '20081229 09:07:07', 'da841a74-e792-4013-ba70-7b3dfa4dea12', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5303, N'delete', 0, N'DELETE FROM COM_PaymentShipping WHERE [PaymentOptionID] = @PaymentOptionID AND [ShippingOptionID] = @ShippingOptionID', 0, 1661, 0, '20081229 09:07:15', '8416ad26-2505-44a5-9d9a-f3e4791ac7bc', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5304, N'insert', 0, N'INSERT INTO COM_PaymentShipping ([PaymentOptionID], [ShippingOptionID] ) VALUES ( @PaymentOptionID, @ShippingOptionID);', 1, 1661, 0, '20081229 09:07:15', '292483e3-4293-4a5b-abc8-d2de0180e3da', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5305, N'update', 0, N'SELECT NULL', 0, 1661, 0, '20081229 09:07:15', 'b9bd6c08-0c05-45d7-b3d5-58efff1a4565', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5287, N'InitCategoryOrders', 1, N'Proc_CMS_SettingsCategory_InitCategoryOrders', 0, 1649, 0, '20080325 00:00:00', '10e7c9b8-045f-4a12-b9f7-effb45c26547', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5288, N'MoveCategoryDown', 1, N'Proc_CMS_SettingsCategory_MoveCategoryDown', 0, 1649, 0, '20080325 00:00:00', '075b10f9-7d2c-45a1-9842-0c13ded94099', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5289, N'MoveCategoryUp', 1, N'Proc_CMS_SettingsCategory_MoveCategoryUp', 0, 1649, 0, '20080325 00:00:00', '28acb8f3-4b95-4234-b091-b34b20160833', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5164, N'delete', 0, N'DELETE FROM CMS_AllowedChildClasses WHERE [ParentClassID] = @ParentClassID AND [ChildClassID] = @ChildClassID', 0, 1639, 0, '20081229 09:06:53', '81e511e1-27a6-4d4f-b650-3a9ef09721e8', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5165, N'insert', 0, N'INSERT INTO CMS_AllowedChildClasses ([ParentClassID], [ChildClassID] ) VALUES ( @ParentClassID, @ChildClassID);', 1, 1639, 0, '20081229 09:06:53', 'f8387535-3e1e-48eb-b36f-9756dd796727', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5166, N'update', 0, N'SELECT NULL', 0, 1639, 0, '20081229 09:06:53', '95501a56-ad91-4aaf-87d7-93d153ef8922', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5160, N'removedocumentdependencies', 0, N'UPDATE Forums_Forum SET [ForumDocumentID] = NULL WHERE ForumDocumentID = @ID', 0, 1122, 0, '20080305 14:13:14', '158661ad-cc34-43ed-b4be-cb588c1dc722', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5151, N'insert', 0, N'INSERT INTO CMS_ClassSite ([ClassID], [SiteID] ) VALUES ( @ClassID, @SiteID);', 1, 1637, 0, '20081229 09:06:58', '8c0f54d3-2380-4293-9941-2db3c2519ba0', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5152, N'update', 0, N'SELECT NULL', 0, 1637, 0, '20081229 09:06:58', 'e5386368-292a-4f8c-bc48-f305d4fe68a8', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5312, N'sortalphabetically', 1, N'Proc_COM_OptionCategory_SortAlphabetically', 1, 1596, 0, '20080327 00:00:00', '48f82970-688e-4d56-baba-d33ac555e0d2', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6177, N'delete', 0, N'DELETE FROM CMS_TagGroup WHERE [TagGroupID] = @ID', 0, 1736, 0, '20081229 09:07:24', '8328ae98-c707-45f5-ae37-655656e569c8', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6178, N'insert', 0, N'INSERT INTO CMS_TagGroup ([TagGroupDisplayName], [TagGroupName], [TagGroupDescription], [TagGroupSiteID], [TagGroupIsAdHoc], [TagGroupLastModified], [TagGroupGUID] ) VALUES ( @TagGroupDisplayName, @TagGroupName, @TagGroupDescription, @TagGroupSiteID, @TagGroupIsAdHoc, @TagGroupLastModified, @TagGroupGUID); SELECT SCOPE_IDENTITY() AS [TagGroupID]', 1, 1736, 0, '20081229 09:07:24', 'bfdc8abe-689f-4a7b-b71f-5343bc27e883', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6179, N'update', 0, N'UPDATE CMS_TagGroup SET [TagGroupDisplayName] = @TagGroupDisplayName, [TagGroupName] = @TagGroupName, [TagGroupDescription] = @TagGroupDescription, [TagGroupSiteID] = @TagGroupSiteID, [TagGroupIsAdHoc] = @TagGroupIsAdHoc, [TagGroupLastModified] = @TagGroupLastModified, [TagGroupGUID] = @TagGroupGUID WHERE [TagGroupID] = @TagGroupID', 0, 1736, 0, '20081229 09:07:24', '64b26969-7e63-48cb-ba47-1c815c41805e', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6480, N'isroleallowedforboard', 0, N'SELECT * FROM Board_Role WHERE RoleID=@RoleID AND BoardID=@BoardID', 0, 1788, 0, '20080826 12:24:08', '379cba56-377e-4b08-93fb-1a38902887da', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6183, N'delete', 0, N'DELETE FROM CMS_DocumentTag WHERE [DocumentID] = @DocumentID AND [TagID] = @TagID', 0, 1737, 0, '20081229 09:06:59', '4da569ad-f666-40b1-bf8f-331deada55fb', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6184, N'insert', 0, N'INSERT INTO CMS_DocumentTag ([DocumentID], [TagID] ) VALUES ( @DocumentID, @TagID);', 1, 1737, 0, '20081229 09:06:59', '30a3c1ad-1e6e-498f-9671-ac4437a9a1e8', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6185, N'update', 0, N'SELECT NULL', 0, 1737, 0, '20081229 09:06:59', 'b3a51d21-e571-4c1a-80dd-3990daf02e4a', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (6623, N'removedependencies', 1, N'Proc_Notification_Template_RemoveDependencies', 0, 1813, 0, '20080829 00:00:00', '12457896-1234-1234-1234-1234567890aa', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7048, N'createmassemails', 1, N'Proc_CMS_Email_CreateMassEmails', 0, 1809, 0, '20081118 14:03:27', '7542861b-d8ec-4536-aa1b-20fc2511eae9', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7055, N'stickthread', 1, N'Proc_Forums_ForumPost_StickThread', 0, 1123, 0, '20080922 23:05:07', '5d37115a-61c5-4284-b294-850fbd794789', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7056, N'moveupstickythread', 1, N'Proc_Forums_ForumPost_MoveUpStickyThread', 0, 1123, 0, '20080922 23:05:35', 'ecc1ea97-d74f-4665-b21e-8a9682096cf9', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7057, N'movedownstickythread', 1, N'Proc_Forums_ForumPost_MoveDownStickyThread', 0, 1123, 0, '20080922 23:06:24', '56204f69-44e4-41ee-80f5-2c62f5bd968a', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7192, N'updatecounts', 1, N'Proc_Board_Message_UpdateCounts', 1, 1791, 0, '20081016 17:46:49', '948c1e88-8dc8-4a56-8d4d-adf09f51ba2e', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7217, N'splitthread', 0, N'UPDATE Forums_ForumPost SET [PostIDPath] = Substring([PostIDPath], @PrefixLength + 1, LEN([PostIDPath]) - @PrefixLength), [PostLevel] = [PostLevel] - @PrefixLevel WHERE [PostIDPath] LIKE (@Prefix + ''/%'')', 0, 1123, 0, '20081201 07:44:58', '24a3b834-a2b2-4c43-a562-dd56cd4adcd1', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7059, N'delete', 0, N'DELETE FROM CMS_EmailUser WHERE [EmailID] = @EmailID AND [UserID] = @UserID', 0, 1926, 0, '20081229 09:07:04', 'dee58530-5203-421b-8d14-a946c7fef198', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7060, N'insert', 0, N'INSERT INTO CMS_EmailUser ([EmailID], [UserID], [LastSendResult], [LastSendAttempt], [Status] ) VALUES ( @EmailID, @UserID, @LastSendResult, @LastSendAttempt, @Status);', 1, 1926, 0, '20081229 09:07:04', 'cdf958a0-3993-42fe-8941-9f5fd204f557', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7152, N'updatefilespath', 1, N'Proc_Media_File_UpdateFilePath', 1, 1935, 0, '20081013 12:53:12', 'a4445d98-e54b-42db-b946-af58c098f447', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7238, N'getversionbyname', 0, N'SELECT ##COLUMNS## FROM CMS_AttachmentHistory WHERE AttachmentName = @AttachmentName AND AttachmentHistoryID IN (SELECT AttachmentHistoryID FROM CMS_VersionAttachment WHERE VersionHistoryID = @VersionHistoryID)', 0, 516, 0, '20091012 10:36:38', '0bc51534-6f52-45ab-9437-c4f1e429d70d', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7240, N'GetPostForumGroup', 0, N'SELECT ##TOPN## ##COLUMNS## FROM View_Forums_GroupForumPost_Joined WHERE (##WHERE##) ORDER BY ##ORDERBY##', 0, 1123, 0, '20081020 17:11:42', '6a649b3f-67a8-43aa-a5b3-cd8d7fc39bcd', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7542, N'createmails', 1, N'Proc_Newsletter_Emails_CreateMails', 0, 919, 0, '20081104 09:12:20', '17e7e571-1523-4dc3-8713-9020095dfb7a', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5201, N'delete', 0, N'DELETE FROM Polls_PollSite WHERE [PollID] = @PollID AND [SiteID] = @SiteID', 0, 1646, 0, '20081229 09:07:16', '6c1bc6aa-f807-4494-8c5e-b083d6780189', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5202, N'insert', 0, N'INSERT INTO Polls_PollSite ([PollID], [SiteID] ) VALUES ( @PollID, @SiteID);', 1, 1646, 0, '20081229 09:07:16', 'fcd5f8d5-a959-49e1-ba55-62c69a9cf2f7', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5203, N'update', 0, N'SELECT NULL', 0, 1646, 0, '20081229 09:07:16', '01dd6e4b-cb5e-447d-8673-d3af60a364b8', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7095, N'documentboardscount', 0, N'SELECT COUNT(BoardID) FROM Board_Board WHERE BoardDocumentID = @DocumentID', 0, 1788, 0, '20081001 17:41:31', 'a0566f13-a8fc-4350-9c96-cc42659edfec', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7096, N'documentforumscount', 0, N'SELECT COUNT(ForumID) FROM Forums_Forum WHERE ForumDocumentID= @DocumentID', 0, 1122, 0, '20081001 17:49:03', '697351e0-3860-4105-85a8-6e2d141d5198', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7097, N'removedependencies', 1, N'Proc_CMS_Badge_RemoveDependencies', 0, 1787, 0, '20081202 08:21:29', 'cf3ebfcf-9d0e-4495-bdae-f723ec375531', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7106, N'count', 0, N'SELECT COUNT(*) AS [Count] FROM Forums_Attachment WHERE AttachmentPostID = @PostID', 0, 1912, 0, '20081003 11:01:46', 'db84d606-8516-4031-aadf-f55ea7169844', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7118, N'delete', 0, N'DELETE FROM Media_Library WHERE [LibraryID] = @ID', 0, 1934, 0, '20081229 09:07:11', 'b2243980-10ab-4367-ac41-b55cffb32ef4', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (7110, N'updateuserbadge', 0, N'UPDATE CMS_UserSettings SET UserBadgeID = (SELECT TOP 1 BadgeID FROM CMS_Badge WHERE (ISNULL(UserActivityPoints,0) < BadgeTopLimit AND BadgeIsAutomatic = 1) ORDER BY BadgeTopLimit) WHERE (ISNULL(UserBadgeID,0) NOT IN (SELECT BadgeID FROM CMS_Badge WHERE BadgeIsAutomatic = 0)) AND (##WHERE##)', 0, 1787, 0, '20081202 08:34:24', '8d87c0e5-73f9-452f-90fa-9d4d966f9831', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (198, N'isauthorizedperclass', 0, N'DECLARE @ClassID int; SET @ClassID = (SELECT TOP 1 ClassID FROM CMS_Class WHERE ClassName = @ClassName); DECLARE @PermissionID int; SET @PermissionID = (SELECT TOP 1 PermissionID FROM CMS_Permission WHERE PermissionName = @PermissionName); DECLARE @UserID int; SET @UserID = (SELECT TOP 1 UserID FROM CMS_User WHERE UserName = @Username); SELECT * FROM CMS_Permission WHERE PermissionID = @PermissionID AND ClassID = @ClassID AND PermissionID IN ( SELECT PermissionID FROM CMS_RolePermission WHERE RoleID IN (SELECT RoleID FROM CMS_UserRole WHERE UserID = @UserID) )', 0, 59, 0, '20080313 09:35:00', '651384c6-6d54-436e-81bc-c2b886b2b386', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (199, N'isauthorizedperresource', 0, N'DECLARE @ResourceID int; SET @ResourceID = (SELECT FIRST ResourceID FROM CMS_Resource WHERE ResourceName = @ResourceName); DECLARE @PermissionID int; SET @PermissionID = (SELECT FIRST PermissionID FROM CMS_Permission WHERE PermissionName = @PermissionName); DECLARE @UserID int; SET @UserID = (SELECT FIRST UserID FROM CMS_User WHERE UserName = @UserName); SELECT * FROM CMS_Permission WHERE PermissionID = @PermissionID AND ResourceID = @ResourceID AND PermissionID IN ( SELECT PermissionID FROM CMS_RolePermission WHERE RoleID IN (SELECT RoleID FROM CMS_UserRole WHERE UserID = @UserID) )', 0, 59, 0, '20080313 09:35:00', 'e4fab6ce-2588-4751-a4bd-5566ca2b764b', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (60, N'removeuserfromsite', 0, N'DELETE FROM CMS_UserSite WHERE UserID=@UserID AND SiteID=@SiteID', 0, 59, 0, '20080313 09:35:00', '0d5467ed-0af5-45bf-91d7-afb98e64bff2', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (62, N'authenticateuser', 0, N'SELECT * FROM CMS_User WHERE UserName=@UserName AND UserPassword=@UserPassword', 0, 59, 0, '20080313 09:35:00', 'bb2b7e78-3880-4cb0-a4d3-00d61f476147', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (404, N'insert', 0, N'INSERT INTO CMS_WorkflowStep ([StepDisplayName], [StepName], [StepOrder], [StepWorkflowID], [StepGUID], [StepLastModified] ) VALUES ( @StepDisplayName, @StepName, @StepOrder, @StepWorkflowID, @StepGUID, @StepLastModified); SELECT SCOPE_IDENTITY() AS [StepID]', 1, 172, 0, '20081229 09:07:41', '51e6960e-62e0-43c4-8c2f-4868c7cc1b15', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (405, N'update', 0, N'UPDATE CMS_WorkflowStep SET [StepDisplayName] = @StepDisplayName, [StepName] = @StepName, [StepOrder] = @StepOrder, [StepWorkflowID] = @StepWorkflowID, [StepGUID] = @StepGUID, [StepLastModified] = @StepLastModified WHERE [StepID] = @StepID', 0, 172, 0, '20081229 09:07:41', 'ae71fad2-62a8-4b77-8843-c3b0ca098b67', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (402, N'delete', 0, N'DELETE FROM CMS_WorkflowStep WHERE [StepID] = @ID', 0, 172, 0, '20081229 09:07:41', '0c47885e-5fe3-4971-a7a8-0010dc2ef4dc', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (1295, N'delete', 0, N'DELETE FROM Newsletter_EmailTemplate WHERE [TemplateID] = @ID', 0, 905, 0, '20081229 09:07:12', 'c67aa1a0-190c-497c-80c1-71a0c41cccd6', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2290, N'deletetask', 1, N'Proc_CMS_Webfarm_DeleteTask', 0, 1093, 0, '20080313 09:35:00', '4ce489d6-3635-40b6-8316-5e707a5f22fc', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (411, N'delete', 0, N'DELETE FROM CMS_WorkflowScope WHERE [ScopeID] = @ID', 0, 175, 0, '20090415 18:09:55', '351e4b35-ed3b-4860-8985-438b64ebbcb2', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (187, N'AddResourceToSite', 0, N'INSERT INTO [CMS_ResourceSite] (ResourceID, SiteID) VALUES (@ResourceID, @SiteID)', 0, 134, 0, '20080313 09:35:00', '5c4e7e20-b447-492a-9908-7e0a8cec9b38', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (188, N'RemoveResourceFromSite', 0, N'DELETE FROM [CMS_ResourceSite] WHERE ResourceID = @ResourceID AND SiteID = @SiteID', 0, 134, 0, '20080313 09:35:00', '2a560aae-d7b3-4ee5-aaed-157796434ebb', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (189, N'delete', 0, N'DELETE FROM CMS_Resource WHERE [ResourceID] = @ID', 0, 134, 0, '20091124 19:02:33', '8526c6b9-03dc-462a-92a7-6f4380f7fdc5', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (205, N'clearevents', 0, N'DELETE FROM [CMS_EventLog] WHERE ##WHERE##', 0, 140, 0, '20080313 09:35:00', '8dc91804-e2a7-455f-9661-6c8d02eccf09', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (182, N'update', 0, N'UPDATE CMS_Resource SET [ResourceDisplayName] = @ResourceDisplayName, [ResourceName] = @ResourceName, [ResourceDescription] = @ResourceDescription, [ShowInDevelopment] = @ShowInDevelopment, [ResourceURL] = @ResourceURL, [ResourceGUID] = @ResourceGUID, [ResourceLastModified] = @ResourceLastModified WHERE [ResourceID] = @ResourceID', 0, 134, 0, '20091124 19:02:33', '634e271d-bb71-4874-b572-1a37553b0802', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (183, N'insert', 0, N'INSERT INTO CMS_Resource ([ResourceDisplayName], [ResourceName], [ResourceDescription], [ShowInDevelopment], [ResourceURL], [ResourceGUID], [ResourceLastModified] ) VALUES ( @ResourceDisplayName, @ResourceName, @ResourceDescription, @ShowInDevelopment, @ResourceURL, @ResourceGUID, @ResourceLastModified); SELECT SCOPE_IDENTITY() AS [ResourceID]', 1, 134, 0, '20091124 19:02:33', '8e49034e-7cc3-4238-bd60-b654d72162ab', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2735, N'CheckDependencies', 0, N'SELECT TOP 1 ShippingOptionID FROM COM_ShippingOption WHERE (ShippingOptionID = (SELECT TOP 1 CustomerPreferredShippingOptionID FROM COM_Customer WHERE (CustomerPreferredShippingOptionID = @ID))) OR (ShippingOptionID = (SELECT TOP 1 OrderShippingOptionID FROM COM_Order WHERE (OrderShippingOptionID = @ID)))OR(ShippingOptionID = (SELECT TOP 1 ShoppingCartShippingOptionID FROM COM_ShoppingCart WHERE (ShoppingCartShippingOptionID = @ID)))', 0, 1150, 0, '20080313 09:35:00', '92292644-4df2-4df1-9771-443f7d4a4284', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5051, N'delete', 0, N'DELETE FROM CMS_CssStylesheetSite WHERE [StylesheetID] = @StylesheetID AND [SiteID] = @SiteID', 0, 1629, 0, '20081229 09:06:58', '6a8672e4-80d8-48c1-a8da-28aedac1c99f', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5052, N'insert', 0, N'INSERT INTO CMS_CssStylesheetSite ([StylesheetID], [SiteID] ) VALUES ( @StylesheetID, @SiteID);', 1, 1629, 0, '20081229 09:06:58', 'e44cc7ef-06de-496e-bec0-cc5acb8d6ae1', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5053, N'update', 0, N'SELECT NULL', 0, 1629, 0, '20081229 09:06:58', '2bb89372-3d4b-4381-ae55-4a28083e0002', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5037, N'initorders', 1, N'Proc_CMS_WebTemplate_InitOrders', 1, 500, 0, '20080313 09:35:00', 'c0caeaeb-bce9-44b6-88cf-e3f030164277', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5038, N'moveup', 1, N'Proc_CMS_WebTemplate_MoveUp', 1, 500, 0, '20080313 09:35:00', 'a4fcd95e-e5d4-4de2-b5b5-d947a7b3bc6a', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5039, N'movedown', 1, N'Proc_CMS_WebTemplate_MoveDown', 1, 500, 0, '20080313 09:35:00', '69ec0159-98fa-41a2-8226-26a882092be2', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (603, N'insert', 0, N'INSERT INTO CMS_PageTemplateCategory ([CategoryDisplayName], [CategoryParentID], [CategoryName], [CategoryGUID], [CategoryLastModified], [CategoryImagePath], [CategoryChildCount], [CategoryTemplateChildCount], [CategoryPath], [CategoryOrder], [CategoryLevel] ) VALUES ( @CategoryDisplayName, @CategoryParentID, @CategoryName, @CategoryGUID, @CategoryLastModified, @CategoryImagePath, @CategoryChildCount, @CategoryTemplateChildCount, @CategoryPath, @CategoryOrder, @CategoryLevel); SELECT SCOPE_IDENTITY() AS [CategoryID]', 1, 405, 0, '20091103 08:50:35', '84a38ed2-b8be-429b-b6ad-8ca42faa9d40', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2701, N'deleterelationships', 0, N'DELETE FROM CMS_Relationship WHERE ##WHERE##', 1, 537, 0, '20080313 09:35:00', '46ad60e6-bf3a-4d5d-a95c-2c059af31a2a', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2702, N'initstatusorders', 1, N'Proc_COM_OrderStatus_InitStatusOrders', 1, 1146, 0, '20080313 09:35:00', 'ad5f5e37-8053-4e75-8a8e-e4dae4308828', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2703, N'movestatusdown', 1, N'Proc_COM_OrderStatus_MoveStatusDown', 1, 1146, 0, '20080313 09:35:00', '7a6f7831-eb54-47ee-b6ad-45ae68397854', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2704, N'movestatusup', 1, N'Proc_COM_OrderStatus_MoveStatusUp', 1, 1146, 0, '20080313 09:35:00', '3d111b90-5760-446a-8b4d-9b6483750f2e', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5737, N'DeleteWebFarmServerTask', 0, N'DELETE FROM CMS_WebFarmServerTask WHERE ServerID = @ServerID AND TaskID = @TaskID', 0, 1094, 0, '20080708 18:22:00', 'e05901e7-5392-4d22-87da-c7bdda95dda4', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5738, N'DeleteAllTasks', 0, N'DELETE CMS_WebFarmServerTask FROM CMS_WebFarmServerTask INNER JOIN CMS_WebFarmTask ON CMS_WebFarmTask.TaskID = CMS_WebFarmServerTask.TaskID WHERE CMS_WebFarmServerTask.ServerID = @ServerID AND (##WHERE##)', 0, 1094, 0, '20080709 12:58:30', 'c0b6f12c-841a-4192-8b79-c13e21410d89', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5060, N'delete', 0, N'DELETE FROM CMS_InlineControlSite WHERE [ControlID] = @ControlID AND [SiteID] = @SiteID', 0, 1630, 0, '20081229 09:07:09', '28f5ea64-3ca9-43b6-954d-772258c5987f', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5061, N'insert', 0, N'INSERT INTO CMS_InlineControlSite ([ControlID], [SiteID] ) VALUES ( @ControlID, @SiteID);', 1, 1630, 0, '20081229 09:07:09', '0a4bdf8f-2c32-4718-8706-cefaa0f469ca', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (5062, N'update', 0, N'SELECT NULL', 0, 1630, 0, '20081229 09:07:09', 'e49fce8d-1942-4d00-9286-1e9662f683b6', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2709, N'CheckDependencies', 0, N'SELECT TOP 1 DiscountCouponID FROM [COM_DiscountCoupon]  WHERE ( (DiscountCouponID = (SELECT TOP 1 OrderDiscountCouponID FROM [COM_ORDER] WHERE OrderDiscountCouponID=@ID ) )OR(DiscountCouponID = (SELECT TOP 1 ShoppingCartDiscountCouponID FROM [COM_ShoppingCart] WHERE ShoppingCartDiscountCouponID = @ID )) )', 0, 1149, 0, '20080313 09:35:00', '739c1d60-f94d-4572-bcc9-f9e5e88eeb74', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2920, N'getmoderator', 0, N'SELECT * FROM Forums_ForumModerators Where UserID=@ID', 0, 1122, 0, '20080313 09:35:00', 'ba821f50-69d7-4c0b-9e34-35e27700a75b', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2915, N'getmoderators', 0, N'SELECT * FROM [CMS_USER] WHERE UserID IN (SELECT UserID FROM [Forums_ForumModerators] WHERE ForumID = @ForumID)', 0, 1122, 0, '20080313 09:35:00', '320c2790-0b30-4c56-8dc6-6035bdf4d96f', 2, NULL)
INSERT INTO [CMS_Query] ([QueryID], [QueryName], [QueryTypeID], [QueryText], [QueryRequiresTransaction], [ClassID], [QueryIsLocked], [QueryLastModified], [QueryGUID], [QueryLoadGeneration], [QueryIsCustom]) VALUES (2962, N'checkDependencies', 0, N'SELECT * FROM COM_SKU WHERE SKUManufacturerID = @ID', 0, 1142, 0, '20080313 09:35:00', '0882afd8-a989-447b-9df1-28b4f19fa196', 2, NULL)
SET IDENTITY_INSERT [CMS_Query] OFF
